package com.nervenets.web.hibernate.domain;

import com.nervenets.web.enumeration.Role;
import com.nervenets.web.hibernate.DomainObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;

/**
 * 后台管理员类
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "managers", indexes = {
        @Index(name = "login_idx", columnList = "mobile,password")
})
public class Manager extends DomainObject {
    private String mobile;
    private String password;
    private String name;
    private String contactName;
    private String contactMobile;
    private Role role;
    private String logo;
    private String cardLogo;
    private String coverImage;
    private String shareImage;
    private int freeDays;
    private int price;
    private int disable;
    @Column(columnDefinition = "text")
    private String intro;

    public Manager(String mobile, String password) {
        this.mobile = mobile;
        this.password = password;
    }
}
